home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / a_utils / _archvrs / unix / shar.lha / shar / mem.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-12-03  |  460 b   |  24 lines

  1. /*
  2. **  Get some memory or die trying.
  3. */
  4. /* LINTLIBRARY */
  5. #include "shar.h"
  6. RCS("$Header: mem.c,v 1.6 87/03/04 14:51:20 rs Exp $")
  7.  
  8.  
  9. align_t
  10. getmem(i, j)
  11.     unsigned int     i;
  12.     unsigned int     j;
  13. {
  14.     extern char        *calloc();
  15.     align_t         p;
  16.  
  17.     if ((p = (align_t)calloc(i, j)) == NULL) {
  18.     /* Print the unsigned's as int's so ridiculous values show up. */
  19.     fprintf(stderr, "Can't Calloc(%d,%d), %s.\n", i, j, Ermsg(errno));
  20.     exit(1);
  21.     }
  22.     return(p);
  23. }
  24.